<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/hx/web/public/css/bootstrap.min.css">
    <link rel="stylesheet" href="/hx/web/public/mycss/admin.css">
</head>
<body class="login">
    <div class="container-fiuld mt120">
        <div id="login">
            <h1 class="text-center"><?php echo ($title); ?></h1>
            <hr>
            <form action="<?php echo U('Login/index');?>" method="post" class="col-md-offset-4 col-md-4" name="login">
                <div class="form-group">
                    <div class="col-md-3 control-label">
                        name:
                    </div>
                    <div class="col-md-4">
                        <input type="text" name="name" placeholder="请输入用户名" value="<?php echo cookie('name');?>">
                    </div>
                </div><br><br>
                <div class="form-group">
                    <div class="col-md-3 control-label">
                        password:
                    </div>
                    <div class="col-md-4">
                        <input type="password" name="pwd" placeholder="请输入密码" value="<?php echo cookie('pwd');?>">
                    </div>
                </div><br><br>
                <div class="form-group">
                    <div class="col-md-2 control-label mt10">
                        <input type="text" name="vcode" size="10">
                    </div>
                    <div class="col-md-2 col-md-offset-2">
                        <img src="<?php echo U('Login/vcode');?>" width="150" title="点 我 刷 新" style="cursor:pointer" onclick="this.src=this.src+'?i='+Math.random()">
                    </div>
                </div><br><br><br>
                <div class="form-group">
                    <div class="col-md-4">
                        <input type="checkbox" name="rname" id="rem">记住密码
                    </div>
                </div><br>
                <div class="form-group">
                    <div class="col-md-4 col-md-offset-1">
                        <button class="btn btn-success">登&nbsp;&nbsp;&nbsp;&nbsp;录</button>
                    </div>
                </div><br>
            </form>
        </div>
    </div>

    <script src="/hx/web/public/myjs/jquery-1.8.3.min.js"></script>
    <script>
        $('#rem').click(function(){
            //设置过期时间
            var d = new Date();//获取时间
            //未来的时间
            d.setTime(d.getTime()+3600*1000);
            document.cookie = "name="+document.login.name.value+";path=/;expires="+d.toUTCString();
            document.cookie = "pwd="+document.login.pwd.value+";path=/;expires="+d.toUTCString();
        })

        if (("<?php echo cookie('name');?>" != '') && ("<?php echo cookie('pwd');?>" != '')) {
            $('#rem').attr('checked', 'checked');
        }
    </script>
</body>
</html>